package com.xcl.service.impl;

import com.xcl.mapper.DeliveryListMapper;
import com.xcl.pojo.UpdateXclDeliveryList;
import com.xcl.pojo.XclDeliveryList;
import com.xcl.service.DeliveryListServiceInter;
import com.zzg.entity.Driver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName DeliveryListServiceImpl
 * @Description 派送列表服务层实现类
 * @Author: xiaochaolei
 * @date 2021/7/14 17:34
 * @Version 1. 0
 */
@Service
public class DeliveryListServiceImpl implements DeliveryListServiceInter {

    @Autowired
    DeliveryListMapper deliveryListMapper;

    @Override
    public List<XclDeliveryList> getXclDeliveryListAll() {
        return deliveryListMapper.getXclDeliveryListAll();
    }

    @Override
    public List<XclDeliveryList> getXclDeliveryListAllByLimit(int page, int limit) {
        return deliveryListMapper.getXclDeliveryListAllByLimit((page-1)*limit,limit);
    }

    @Override
    public List<XclDeliveryList> getXclDeliveryListAllByWhere(int page, int limit, String waybill_id, String sub_id, String startDate, String endingDate, String ownerName) {
        return deliveryListMapper.getXclDeliveryListAllByWhere((page-1)*limit,limit,waybill_id,sub_id,startDate,endingDate,ownerName);
    }

    @Override
    public Driver getDriverById(String id) {
        return deliveryListMapper.getDriverById(id);
    }

    @Override
    public UpdateXclDeliveryList getUpdateXclDeliveryListByDeliveryid(String id) {
        return deliveryListMapper.getUpdateXclDeliveryListByDeliveryid(id);
    }

    @Override
    public int updateXclDelivery(String deliveryDate, String substation, String sub_id,String delivery_id) {
        return deliveryListMapper.updateXclDelivery(deliveryDate,substation,sub_id,delivery_id);
    }

    @Override
    public Driver getDriverByLicenseTag(String id) {
        return deliveryListMapper.getDriverByLicenseTag(id);
    }
}
